package com.lu.admin.controller.v1;


import com.lu.api.wemedia.IWemediaClient;
import com.lu.model.admin.dto.SensitiveDto;
import com.lu.model.admin.pojo.AdSensitive;
import com.lu.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
@Api(value = "平台管理端敏感词模块", tags = "ad_sensitive")
public class AdSensitiveController {

    @Autowired
    private IWemediaClient wemediaClient;



    /**
     * 敏感词删除
     * @param id
     * @return
     */
    @ApiOperation(value = "删除敏感词")
    @DeleteMapping("/del/{id}")
    public ResponseResult remove(@PathVariable("id") Integer id) {
        return wemediaClient.remove(id);
    }

    /**
     * 敏感词列表
     * @return
     */
    @ApiOperation(value = "查询敏感词列表")
    @PostMapping("/list")
    public ResponseResult list(@RequestBody SensitiveDto dto) {
        return wemediaClient.list(dto);
    }


    /**
     * 保存敏感词
     * @param adSensitive
     * @return
     */
    @ApiOperation(value = "保存敏感词")
    @PostMapping("/save")
    public ResponseResult save(@RequestBody AdSensitive adSensitive) {
        return wemediaClient.save(adSensitive);
    }


    /**
     * 修改铭感词
     * @param adSensitive
     * @return
     */
    @ApiOperation(value = "修改敏感词")
    @PostMapping("/update")
    public ResponseResult update(@RequestBody AdSensitive adSensitive) {
        return wemediaClient.update(adSensitive);
    }

}
